<?php
namespace app\common\model;

use think\Model;

/**
 * record 汇款记录表
 * 赵振远 2017.12.27 
 * @package app\common\model
 */
class Record extends Model
{
    //自动转换时间戳
    protected $type = [
        're_audit' => 'timestamp:Y-m-d H:i:s',
        're_cashtime' => 'timestamp:Y-m-d H:i:s',
    ];

    //自动转换状态
    public function getReStateAttr($value)
    {
        // 0未付款1付款
        $re_state = [-1 => '待汇款', 1 => '已汇款'];
        return $re_state[$value];
    }

    //设置主键
    protected $pk = 're_id';
}
